|
FMI Ticket System
| Kamen Mladenov | FMI Computer Science Year 1 Group 6 | Project 1 | Project Topic 4 |
|
Each Reservations contains a ticket, a password and a note. More...
#include <Reservation.h>
Public Member Functions | |
| Reservation () | |
| Sets ticket as default value and leaves password and note blank. | |
| Reservation (const Ticket &ticket) | |
| Sets ticket and leaves password and note blank. | |
| Reservation (const Ticket &ticket, const char *password, const char *note) | |
| Sets ticket, password and note. | |
| const Ticket & | get_ticket () const |
| Returns constant reference to ticket. | |
| const char * | get_password () const |
| Returns constant C-style string to password. | |
| const char * | get_note () const |
| Returns constant C-style string to note. | |
| void | read (std::istream &istr) |
| Reads Reservation from stream. More... | |
| void | write (std::ostream &ostr) const |
| Writes Reservation to stream. More... | |
| int | compare (const Reservation &other) const |
| Compares two Reservations. More... | |
Friends | |
| std::istream & | operator>> (std::istream &istr, Reservation &reservation) |
| Reads Reservation from stream with >> operator. More... | |
| std::ostream & | operator<< (std::ostream &ostr, const Reservation &reservation) |
| Writes Reservation to stream with << operator. More... | |
Each Reservations contains a ticket, a password and a note.
| int Reservation::compare | ( | const Reservation & | other | ) | const |
Compares two Reservations.
| void Reservation::read | ( | std::istream & | istr | ) |
Reads Reservation from stream.
| istr | An input stream |
Directly reads bytes from stream (calls read() function). Uses ticket's read() function.
| void Reservation::write | ( | std::ostream & | ostr | ) | const |
Writes Reservation to stream.
| ostr | An output stream |
Directly writes bytes to stream (calls write() function). Uses ticket's write() function.
|
friend |
Writes Reservation to stream with << operator.
Uses the stream's << operator to write the ticket only.
|
friend |
Reads Reservation from stream with >> operator.
Uses the stream's >> operator to read and parse the ticket. Password and note are left blank.